package com.cn.hibernate.dao.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.cn.hibernate.base.impl.BaseDao;
import com.cn.hibernate.dao.IUserDao;
import com.cn.hibernate.model.User;

@Repository
public class UserDao extends BaseDao<User, Long> implements IUserDao{
	public void test(){
		final String sql = "delete from User";
		excuteHqlUpdate(sql);
	}
	
	public void testBatch(){
		String sql = "insert into user (name,a) values(?,?)";
		List<Object[]> list = new ArrayList<Object[]>();
		Object [] obj = {"呵呵","滚"};
		Object [] obj1 = {"a","c"};
		list.add(obj1);
		list.add(obj);
		excuteBatchSqlUpdate(sql, list);
	}
}
